﻿/*------------------------------------------------
// File Description: Storage DataBase Entity
// Author:			 汪亮
// Create Time:		 2020-05-04 15:31:30
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 库存
    /// </summary>
    [Table(nameof(Storage))]
    public class Storage : BaseEntity
    {
        private string _warehouseCode = string.Empty;
        private string _warehouseName = string.Empty;
        private string _areaCode = string.Empty;
        private string _areaName = string.Empty;
        private string _location = string.Empty;
        private string _productCode = string.Empty;
        private string _productName = string.Empty;
        private string _packBatchNo = string.Empty;
        private string _packNo = string.Empty;
        private string _categoryName;
        private string _categoryCode;
        private string _customerWarehouseCode;
        private string _customerWarehouseName;
        private string _cabinetNo;
        private string _orderNo;
        private string _workOrderNo;
        private string _workshopCode = string.Empty;
        private string _qLevel = string.Empty;
        private string _currentLevel = string.Empty;
        private string _nameplateModel = string.Empty;
        private string _componentColor = string.Empty;
        private string _batterySpecs = string.Empty;
        private string _batteryFactory = string.Empty;
        private string _workshopName;
        private string _customerCode;
        private string _customerName;
        private string _productSpecs;

        #region Public Property

        ///<Summary>
        /// 仓库代码
        ///</Summary>
        public string WarehouseCode
        {
            get { return string.IsNullOrWhiteSpace(_warehouseCode) ? string.Empty : _warehouseCode; }
            set { _warehouseCode = value; }
        }

        ///<Summary>
        /// 仓库名称
        ///</Summary>
        public string WarehouseName
        {
            get { return string.IsNullOrWhiteSpace(_warehouseName) ? string.Empty : _warehouseName; }
            set { _warehouseName = value; }
        }

        ///<Summary>
        /// 客户仓库代码
        ///</Summary>
        public string CustomerWarehouseCode
        {
            get { return string.IsNullOrWhiteSpace(_customerWarehouseCode) ? string.Empty : _customerWarehouseCode; }
            set { _customerWarehouseCode = value; }
        }

        ///<Summary>
        /// 客户仓库名称
        ///</Summary>
        public string CustomerWarehouseName
        {
            get { return string.IsNullOrWhiteSpace(_customerWarehouseName) ? string.Empty : _customerWarehouseName; }
            set { _customerWarehouseName = value; }
        }

        ///<Summary>
        /// 库区代码
        ///</Summary>
        public string AreaCode
        {
            get { return string.IsNullOrWhiteSpace(_areaCode) ? string.Empty : _areaCode; }
            set { _areaCode = value; }
        }

        ///<Summary>
        /// 库区名称
        ///</Summary>
        public string AreaName
        {
            get { return string.IsNullOrWhiteSpace(_areaName) ? string.Empty : _areaName; }
            set { _areaName = value; }
        }

        ///<Summary>
        /// 库位名称
        ///</Summary>
        public string Location
        {
            get { return string.IsNullOrWhiteSpace(_location) ? string.Empty : _location; }
            set { _location = value; }
        }

        ///<Summary>
        /// 物料类型
        ///</Summary>
        public Enum.InventoryType InventoryType { get; set; }

        ///<Summary>
        /// 分类编码
        ///</Summary>
        public string CategoryCode
        {
            get { return string.IsNullOrWhiteSpace(_categoryCode) ? string.Empty : _categoryCode; }
            set { _categoryCode = value; }
        }

        ///<Summary>
        /// 分类名称
        ///</Summary>
        public string CategoryName
        {
            get { return string.IsNullOrWhiteSpace(_categoryName) ? string.Empty : _categoryName; }
            set { _categoryName = value; }
        }

        ///<Summary>
        /// 成品代码
        ///</Summary>
        public string ProductCode
        {
            get { return string.IsNullOrWhiteSpace(_productCode) ? string.Empty : _productCode; }
            set { _productCode = value; }
        }

        ///<Summary>
        /// 成品名称
        ///</Summary>
        public string ProductName
        {
            get { return string.IsNullOrWhiteSpace(_productName) ? string.Empty : _productName; }
            set { _productName = value; }
        }

        ///<Summary>
        /// 成品规格
        ///</Summary>
        public string ProductSpecs
        {
            get { return string.IsNullOrWhiteSpace(_productSpecs) ? string.Empty : _productSpecs; }
            set { _productSpecs = value; }
        }

        ///<Summary>
        /// 包装批次号
        ///</Summary>
        public string PackBatchNo
        {
            get { return string.IsNullOrWhiteSpace(_packBatchNo) ? string.Empty : _packBatchNo; }
            set { _packBatchNo = value; }
        }

        ///<Summary>
        /// 包装号
        ///</Summary>
        public string PackNo
        {
            get { return string.IsNullOrWhiteSpace(_packNo) ? string.Empty : _packNo; }
            set { _packNo = value; }
        }

        ///<Summary>
        /// 柜号
        ///</Summary>
        public string CabinetNo
        {
            get { return string.IsNullOrWhiteSpace(_cabinetNo) ? string.Empty : _cabinetNo; }
            set { _cabinetNo = value; }
        }

        ///<Summary>
        /// 订单号
        ///</Summary>
        public string OrderNo
        {
            get { return string.IsNullOrWhiteSpace(_orderNo) ? string.Empty : _orderNo; }
            set { _orderNo = value; }
        }

        ///<Summary>
        /// 工单号
        ///</Summary>
        public string WorkOrderNo
        {
            get { return string.IsNullOrWhiteSpace(_workOrderNo) ? string.Empty : _workOrderNo; }
            set { _workOrderNo = value; }
        }

        ///<Summary>
        /// 客户代码
        ///</Summary>
        public string CustomerCode
        {
            get { return string.IsNullOrWhiteSpace(_customerCode) ? string.Empty : _customerCode; }
            set { _customerCode = value; }
        }

        ///<Summary>
        /// 客户名称
        ///</Summary>
        public string CustomerName
        {
            get { return string.IsNullOrWhiteSpace(_customerName) ? string.Empty : _customerName; }
            set { _customerName = value; }
        }

        ///<Summary>
        /// 车间代码
        ///</Summary>
        public string WorkshopCode
        {
            get { return string.IsNullOrWhiteSpace(_workshopCode) ? string.Empty : _workshopCode; }
            set { _workshopCode = value; }
        }

        ///<Summary>
        /// 车间名称
        ///</Summary>
        public string WorkshopName
        {
            get { return string.IsNullOrWhiteSpace(_workshopName) ? string.Empty : _workshopName; }
            set { _workshopName = value; }
        }

        ///<Summary>
        /// 数量
        ///</Summary>
        public decimal Quantity { get; set; }

        ///<Summary>
        /// 明细数量（如组件数）
        ///</Summary>
        public decimal DetailQuantity { get; set; }

        ///<Summary>
        /// 等级
        ///</Summary>
        public string QLevel
        {
            get { return string.IsNullOrWhiteSpace(_qLevel) ? string.Empty : _qLevel; }
            set { _qLevel = value; }
        }

        ///<Summary>
        /// PowerLevel
        ///</Summary>
        public decimal? PowerLevel { get; set; }

        ///<Summary>
        /// 电流档
        ///</Summary>
        public string CurrentLevel
        {
            get { return string.IsNullOrWhiteSpace(_currentLevel) ? string.Empty : _currentLevel; }
            set { _currentLevel = value; }
        }

        ///<Summary>
        /// 铭牌型号
        ///</Summary>
        public string NameplateModel
        {
            get { return string.IsNullOrWhiteSpace(_nameplateModel) ? string.Empty : _nameplateModel; }
            set { _nameplateModel = value; }
        }

        ///<Summary>
        /// 组件颜色
        ///</Summary>
        public string ComponentColor
        {
            get { return string.IsNullOrWhiteSpace(_componentColor) ? string.Empty : _componentColor; }
            set { _componentColor = value; }
        }

        ///<Summary>
        /// 电池片规格
        ///</Summary>
        public string BatterySpecs
        {
            get { return string.IsNullOrWhiteSpace(_batterySpecs) ? string.Empty : _batterySpecs; }
            set { _batterySpecs = value; }
        }

        ///<Summary>
        /// 电池片厂家
        ///</Summary>
        public string BatteryFactory
        {
            get { return string.IsNullOrWhiteSpace(_batteryFactory) ? string.Empty : _batteryFactory; }
            set { _batteryFactory = value; }
        }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 库存
        /// </summary>
        public virtual DbSet<Storage> Storages { get; set; }
    }
}